package main

import (
	"github.com/kataras/iris/v12"
	"github.com/kataras/iris/v12/hero"
	"gowork/memberHero/controller"
	"gowork/memberHero/dao"
	"gowork/memberHero/service"
	"gowork/memberHero/model"
)

func main(){
	app := iris.New()

	hero.Register(service.NewMemberSriImp(dao.NewMemberDaoImp()))

	app.PartyFunc("/members", func(r iris.Party) {

		r.Post("/queryAll", hero.Handler(controller.PostMicroquery))

		hero.Register(func(ctx iris.Context) (form model.InfoForm) {
			ctx.ReadForm(&form)
			return
		})
		r.Post("/insertAll", hero.Handler(controller.PostMicroinsert))
	})

	app.Run(iris.Addr(":6951"), iris.WithOptimizations)
}

